package com.xiaoji.ssh.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "users")
public class UsersRoles implements Serializable{
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="ur_id",unique=true,nullable=false)
	private Integer urId;
	
	@ManyToOne
	@JoinColumn(name="users_id")
	private Users usersId;
	
	@ManyToOne
	@JoinColumn(name="roles_id")
	private Roles rolesId;

	public Integer getUrId() {
		return urId;
	}

	public void setUrId(Integer urId) {
		this.urId = urId;
	}

	public Roles getRolesId() {
		return rolesId;
	}

	public void setRolesId(Roles rolesId) {
		this.rolesId = rolesId;
	}

	public Users getUsersId() {
		return usersId;
	}

	public void setUsersId(Users usersId) {
		this.usersId = usersId;
	}

	@Override
	public String toString() {
		return "UsersRoles [urId=" + urId + ", usersId=" + usersId
				+ ", rolesId=" + rolesId + "]";
	}

	public UsersRoles(Integer urId, Users usersId, Roles rolesId) {
		this.urId = urId;
		this.usersId = usersId;
		this.rolesId = rolesId;
	}

	public UsersRoles() {
		super();
	}
	
}
